<f:view
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:pm="http://primefaces.org/mobile" contentType="text/html">
	<f:metadata>
		<f:event listener="#{pageBean.check}" type="preRenderView"></f:event>
	</f:metadata>
	<pm:page title="Shopping View for #{groceryListBean.groceryList.name}">
		<style type="text/css">
			.ui-chkbox-all
				{
				display: none !important;
			}
		</style>
		<h:form>
			<pm:view id="grocerylistshoppingview">
				<pm:header
					title="Shopping View for #{shoppingBean.currentList.name}">
					<f:facet name="left">
						<h:commandButton value="Back" id="back" action="backshopping" />
					</f:facet>
				</pm:header>
				<pm:content>
				
					<p:dataTable id="shoppingList" var="grocItem"
						value="#{shoppingBean.dataModel}"
						selection="#{shoppingBean.selectedItems}" selectionMode="multiple" sortBy="category">
						<p:column headerText="Found" style="width:10%">
							<p:selectBooleanCheckbox value="#{grocItem.shopped}"/>
						</p:column>
						<p:column headerText="Category">#{grocItem.category}</p:column>
						
						<p:column headerText="Item">#{grocItem.name}</p:column>
						<p:column headerText="Amount">#{grocItem.quantity} #{grocItem.measurement}</p:column>
					</p:dataTable>

					<h:commandButton value="Finish Shopping"
						action="#{shoppingBean.finishShopping}" />
				</pm:content>
			</pm:view>
		</h:form>
	</pm:page>

</f:view>
